package com.tender.parser;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
// import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class CustomRequestOriginParser implements RequestOriginParser {
    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        // 解析入参里面的哪个参数，到时候根据配置的值来决定是走白名单还是黑名单
        return httpServletRequest.getParameter("serverName");
    }

}
